package com.pro.api;

import com.aaa.entity.TProduct;
import com.pro.service.ITProductService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("pro")
public class ProductAPI {
    @Resource
    private ITProductService productService;

    // 根据id 查询商品的信息
    @GetMapping("{id}") // pro/1
    public TProduct getById(@PathVariable Integer id){
        //
        TProduct byId = productService.getById(id);
        return byId;

    }
}
